package com.wyk.springbootdemo.timer;

import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.util.Date;

@Component
public class TestTimer {
    @Scheduled(fixedDelay = 3000)
    public void testTimer01() throws InterruptedException {
    Thread.sleep(2000L);
        System.out.println("现在时间"+new Date());
    }
}
